//
//  ViewController.m
//  CoreData
//
//  Created by lhy on 2021/3/16.
//  Copyright © 2021 lhy. All rights reserved.
//

#import "ViewController.h"
#import "CoreDataManager.h"
@interface ViewController ()

@property (nonatomic, strong) CoreDataManager *manager;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.manager insertData:@{} handler:^(BOOL isSaved, NSError * _Nonnull error) {
        NSLog(@"insertData: %d", isSaved);
    }];
    
//    [self.manager deleteData];

    [self.manager fetchData];
}

- (CoreDataManager *)manager {
    if (!_manager) {
        _manager = [CoreDataManager sharedCoreDataManager];
    }
    return _manager;
}


@end
